package com.cn.lp.export.client.export;

import java.util.ArrayList;
import java.util.List;

/**
 * 导出字段的映射
 *
 * @author wuqirong
 * @date 2020-10-19
 * <p>
 * All rights Reserved, Designed www.xiao100.com
 */
public class Export2EntityMapping {

    /** 导出名 */
    private String exportName;

    /** 字段名 */
    private String entityFieldName;

    /** 嵌套映射 */
    private List<Export2EntityMapping> subMapping = new ArrayList<>();

    public static Export2EntityMapping entityMapping(String exportName, String entityFieldName) {
        Export2EntityMapping mapping = new Export2EntityMapping();
        mapping.exportName = exportName;
        mapping.entityFieldName = entityFieldName;
        return mapping;
    }

    public static Export2EntityMapping subMapping(String exportName, List<Export2EntityMapping> subMapping) {
        Export2EntityMapping mapping = new Export2EntityMapping();
        mapping.exportName = exportName;
        mapping.subMapping.addAll(subMapping);
        return mapping;
    }

    public String getExportName() {
        return exportName;
    }

    public String getEntityFieldName() {
        return entityFieldName;
    }

    public List<Export2EntityMapping> getSubMapping() {
        return subMapping;
    }
}
